package com.ctshk.rpc.order.airexpress.mapper;

import com.ctshk.rpc.order.airexpress.base.CustomBaseMapper;
import com.ctshk.rpc.order.airexpress.entity.AirportExpressOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 机场快线订单表 Mapper 接口
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-02-23
 */
public interface AirportExpressOrderMapper extends CustomBaseMapper<AirportExpressOrder> {
    @Select("select id, receivable_amount, pay_expire_date, using_points, coupon_id, member_type from t_airport_express_order where id = #{id}")
    AirportExpressOrder selectPayInfoById(@Param("id") Long id);

    /**
     * 根据部门编号，员工编号，当日日期查询最大订单号
     * @param prefixOrderNumber
     * @return
     */
    @Select("select order_number from t_airport_express_order where order_number like CONCAT(#{prefixOrderNumber},'%') order by order_number desc limit 1")
    String selectMaxNumberByDeptUserNow(@Param("prefixOrderNumber") String prefixOrderNumber);
}
